#ifndef GAMEMESSAGE_H_
#define GAMEMESSAGE_H_

#include <string>
#include "ariba/ariba.h"

using namespace ariba;
using std::string;

using_serialization;

class GameMessage : public ariba::utility::Message {
	VSERIALIZEABLE;

private:

	/** Message type **/
	uint8_t type;
	uint16_t groupID;

public:

	/** All message types in AnyChat **/
	typedef enum _MESSAGE_TYPE {
		GAME_INVALID			= 0,
		GAME_CONNECT			= 1,
		GAME_CONNECT_ACCEPT		= 2,
		REGION_CONNECT			= 3,
		REGION_CONNECT_ACCEPT	= 4,
		GAME_MOVEUPDOWN			= 5, //koordinaten, richtung, geschwindigkeit (?)
		GAME_MOVEROTATION		= 6,
		GAME_SHOT				= 7,
		GAME_PLAYERSTATUS		= 8,
		GAME_ERROR				= 9,  //int::errorCode;
		GAME_PING				= 10,
		GAME_REGION_ALLOCATION  = 11,
		GAME_REGION_DATA		= 12,
		GAME_HOST_OFFER			= 13
	} MESSAGE_TYPE;

	GameMessage(MESSAGE_TYPE _type = GAME_INVALID );

	/** Destructor **/
	virtual ~GameMessage();

	bool isType(MESSAGE_TYPE _type);

	MESSAGE_TYPE getType();
	void setGroupID(uint16_t groupID);
	uint16_t getGroupID();
};

sznBeginDefault( GameMessage, X ) {
	X && type && groupID && Payload();
} sznEnd();

#endif /* GAMEMESSAGE_H_ */
